//
//  LoginCheckUtil.h
//  HaoRenSnack
//
//  Created by shaowei on 13-8-2.
//  Copyright (c) 2013年 LianZhan. All rights reserved.
//

#import <Foundation/Foundation.h>

//正则表达式
#define REGULAR_MAIL @"^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$"
#define REGULAR_PASSWORD @"^([a-zA-Z0-9]{6,20})$"  //数字、字母 6~20位
#define REGULAR_AGE @"^[0-9]{1,2}$"
#define REGULAR_PHONE @"^(13|15|18|17)[0-9]{9}$"
#define REGULAR_OAUTHCODE @"^[0-9]{6}$"

@interface LoginCheckUtil : NSObject

//封装正则验证过程
+ (NSInteger)generateRegularWithPattern:(NSString *)pattern andString:(NSString *)string;

+ (void)setPopErrorAlertEnable:(BOOL)enable;
+ (BOOL)canPopErrorAlertEnable;

+ (BOOL)checkEmail:(NSString *)email;
+ (BOOL)checkPassword:(NSString *)pwd;
+ (BOOL)checkPhoneNumber:(NSString *)phone;
+ (BOOL)checkOAuthCode:(NSString *)oauthCode;

+ (BOOL)checkNickname:(NSString *)name;

@end
